home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 30 / 030.d81 / pick-up blocks (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  4KB  |  133 lines

  1. 0 gosub60100:clr:bk$="[164]"
  2. 5 dim n(3),h(18),l(18),d(18):forn=0to16:readh(n),l(n),d(n):next
  3. 10 poke53280,6:poke53281,3:a=54272:pokea+24,15
  4. 15 n(1)=3:n(2)=5:n(3)=7:gosub300
  5. 20 print"[212]he object of this game is to force":print
  6. 25 print"me to take the last remaining":print
  7. 30 print"block.  [207]n a given turn you may take":print
  8. 35 print"as many blocks from one row [146] as you ":print
  9. 40 print"wish, but you must take at least one.":print
  10. 45 print"[195]an you figure out the trick?":print
  11. 50 print"[215]hen you're ready, press any key.":fora=1to1000:next:poke198,0
  12. 55 geta$:ifa$=""then55
  13. 60 n(1)=3:n(2)=5:n(3)=7:gosub300
  14. 65 gosub300:print"[217]our move.  [215]hich row?  [157]";:gosub60500:printa$:i=val(a$)
  15. 66 ifi>3ori<1then65
  16. 70 print"[212]ake how many?  [157]";:gosub60500:printa$:j=val(a$):ifj>n(i)then65
  17. 75 ifj<1then65
  18. 76 print"[193]re you sure ([217]/[206])"
  19. 80 gosub60500:an$=a$
  20. 81 ifan$="n"oran$="[206]"then65
  21. 82 ifan$<>"y"andan$<>"[217]"then80
  22. 85 n(i)=n(i)-j
  23. 90 if(n(1)<>0)or(n(2)<>0)or(n(3)<>0)then115
  24. 95 print"[147]             [193][200][193]!  [199]otcha!"
  25. 100 gosub 350
  26. 105 print"           [208]lay [193]gain? ([217]/[206])"
  27. 106 gosub60500:an$=a$:ifan$="y"oran$="[217]"then60
  28. 107 ifan$<>"n"andan$<>"[206]"then106
  29. 110 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
  30. 111 print"[147]";:ifer<>63thenend
  31. 112 load"hello connect",8
  32. 115 gosub300:print"[205]y move ...":l=0:s=7:m=o:h=0
  33. 120 fori=1to3:ifn(i)<sthens=n(i):l=i
  34. 125 next
  35. 130 fori=1to3:ifn(i)>sthens=n(i):h=i
  36. 135 next:ifh=0thenh=3:m=2:goto155
  37. 140 t=n(1)+n(2)+n(3)-n(l)-n(h)
  38. 145 fori=1to3:if(n(i)=t)and(i<>h)and(i<>l)thenm=i
  39. 150 next
  40. 155 ifn(l)=1then185
  41. 160 ifn(l)=0then210
  42. 165 ifn(m)=n(h)thenn(l)=0:goto230
  43. 170 ifn(l)=n(m)thenn(h)=0:goto255
  44. 175 if(n(l)=2)and(n(m)=3)thenn(h)=1:goto230
  45. 180 n(l)=n(l)-1:goto230
  46. 185 if(n(m)=1)and(n(h)>1)thenn(h)=1:goto230
  47. 190 ifn(m)=n(h)thenn(l)=0:goto230
  48. 195 if(n(m)=2)and(n(h)>3)thenn(h)=3:goto230
  49. 200 if(n(m)=3)and(n(h)>=3)thenn(h)=2:goto230
  50. 205 n(m)=n(m)-1:goto230
  51. 210 if(n(m)=0)and(n(h)>1)thenn(h)=1:goto230
  52. 215 ifn(m)=1thenn(h)=0:goto255
  53. 220 ifn(m)<>n(h)thenn(h)=n(m):goto230
  54. 225 n(m)=n(m)-1:goto230
  55. 230 forj=1to1000:next
  56. 235 ifn(h)<>0then255
  57. 240 print"[147][215]ell, you did it!"
  58. 245 print"[217]ou beat me fair and square!"
  59. 250 gosub400:goto105
  60. 255 forj=1to1000:next:goto65
  61. 300 print"[144][147]             [208]ick-[213]p [194]locks"
  62. 301 print"             [163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  63. 305 fori=1to3:printi".";
  64. 310 ifn(i)=0then325
  65. 315 fork=1ton(i)
  66. 320 print" [146]";:next
  67. 325 print
  68. 330 print:next:print:print
  69. 335 return
  70. 350 pokea+5,9:pokea+6,0
  71. 355 forn=6to16:pokea,l(n):pokea+1,h(n):pokea+4,17
  72. 360 fort=1tod(n):nextt
  73. 365 pokea+4,16:fort=1to10:next:next
  74. 370 return
  75. 400 pokea+5,9:pokea+6,0
  76. 405 forn=0to5:pokea,l(n):pokea+1,h(n):pokea+4,33
  77. 410 fort=1tod(n):nextt
  78. 415 pokea+4,32:fort=1to10:next:next
  79. 420 return
  80. 450 data 16,195,64,21,31,64,25,30,64
  81. 455 data 33,135,128,25,30,64,33,135,128
  82. 460 data 16,195,256,16,195,192,16,195,64
  83. 465 data 16,195,256,19,239,192,18,209,64
  84. 470 data 18,209,128,16,195,128,16,195,128
  85. 475 data 15,210,128,16,195,256
  86. 60100 pn$="[208][201][195][203]-[213][208] [194][204][207][195][203][211]":an$="[194][217]:  [210][207][199][197][210] [211]. [205][193][195][207][205][194][197][210]"
  87. 60110 bo=06:sc=00:cl=15:c1=06:c2=03:c3=06:c4=03:c5=08:c6=07:c7=08
  88. 60120 rem bo - border color
  89. 60121 rem sc - screen color
  90. 60122 rem cl - color on border
  91. 60123 rem c1 - top box outside color
  92. 60124 rem c2 - top box inside color
  93. 60125 rem c3 - bottom box outside color
  94. 60126 rem c4 - bottom box inside color
  95. 60127 rem c5 - 'copyright' color
  96. 60128 rem c6 - 'program name' color
  97. 60129 rem c7 - 'authors name' color
  98. 60130 poke53280,bo:poke53281,sc:print"[147]";:goto60250
  99. 60140 poke646,c1:print" [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  100. 60150 poke646,c2:print" [165]        [204][207][193][196][211][212][193][210] [208][210][197][211][197][206][212][211]:        [167]"
  101. 60170 poke646,c1:print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  102. 60180 poke646,c6:print""tab(20-len(pn$)/2);pn$
  103. 60190 poke646,c7:print""tab(20-len(an$)/2);an$
  104. 60200 poke646,c5:print""tab(13)"[195][207][208][217][210][201][199][200][212] 1986"
  105. 60210 printtab(9)"[195][207][205][205][207][196][207][210][197] [208][213][194][204][201][195][193][212][201][207][206][211]"
  106. 60220 poke646,c3:print" [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  107. 60230 poke646,c4:print" [165]                                  [167]"
  108. 60240 poke646,c3:print" [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][146]";
  109. 60245 poke198,.:goto60360
  110. 60250 poke646,cl
  111. 60255 print" [172][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][187]"
  112. 60260 fora=1to3:gosub60470:next
  113. 60270 gosub60470:print"[145][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
  114. 60280 fora=1to16:gosub60470:next
  115. 60290 print"[145][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175]"
  116. 60300 fora=1to3:gosub60470:next
  117. 60310 print" [188][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][162][146][190]";
  118. 60320 poke53280,bo:poke53281,sc:goto60140
  119. 60360 print"";
  120. 60370 poke646,c2:print"[165][208]ress the [[211][208][193][195][197] [194][193][210]] to continue.[167]"
  121. 60380 fora=1to100
  122. 60390 geta$:ifa$=" "ora$="[160]"thenreturn
  123. 60400 next
  124. 60410 print"";
  125. 60420 print"[165]                                  [167]"
  126. 60430 fora=1to100
  127. 60440 geta$:ifa$=" "ora$="[160]"thenreturn
  128. 60450 next
  129. 60460 goto60360
  130. 60470 print" [161][146][161]":return
  131. 60500 geta$:ifa$=""then60500
  132. 60510 return
  133.